package com.sand.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "houseattachment", schema = "ssh_pro", catalog = "")
public class HouseattachmentEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private int houseId;
    private String housePicture;
    private int isHouse;

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "houseId")
    public int getHouseId() {
        return houseId;
    }

    public void setHouseId(int houseId) {
        this.houseId = houseId;
    }

    @Basic
    @Column(name = "housePicture")
    public String getHousePicture() {
        return housePicture;
    }

    public void setHousePicture(String housePicture) {
        this.housePicture = housePicture;
    }

    @Basic
    @Column(name = "isHouse")
    public int getIsHouse() {
        return isHouse;
    }

    public void setIsHouse(int isHouse) {
        this.isHouse = isHouse;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        HouseattachmentEntity that = (HouseattachmentEntity) o;
        return rid == that.rid && houseId == that.houseId && isHouse == that.isHouse && Objects.equals(housePicture, that.housePicture);
    }

    @Override
    public String toString() {
        return "HouseattachmentEntity{" +
                "rid=" + rid +
                ", houseId=" + houseId +
                ", housePicture='" + housePicture + '\'' +
                ", isHouse=" + isHouse +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, houseId, housePicture, isHouse);
    }
}
